package com.woshengqile.api.version;

import java.io.Serializable;

/**
 * 终端类型枚举对象*
 * 
 */
public enum ClientType  implements Serializable {
    ANDROID("android"),
    IPHONE("iphone"),
    ANDROID_PATCH("androidPatch"),
    IPHONE_PATCH("iphonePatch"),
    STOCK_ANDROID("stockAndroid"),
    STOCK_ANDROID_PATCH("stockAndroidPatch"),
    STOCK_IOS("stockIOS"),
    STOCK_IOS_PATCH("stockIOSPatch");

    private String type;

    ClientType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static ClientType  getClientType(String type) {
        if (ANDROID.type.equalsIgnoreCase(type) ) {
            return ANDROID;
        }

        if (IPHONE.type.equalsIgnoreCase(type) ) {
            return IPHONE;
        }
        
        if (ANDROID_PATCH.type.equalsIgnoreCase(type)) {
			return ANDROID_PATCH;
		}
        
        if (IPHONE_PATCH.type.equalsIgnoreCase(type)) {
			return IPHONE_PATCH;
		}
        
        if (STOCK_ANDROID.type.equalsIgnoreCase(type)) {
			return STOCK_ANDROID;
		}
        
        if (STOCK_ANDROID_PATCH.type.equalsIgnoreCase(type)) {
			return STOCK_ANDROID_PATCH;
		}
        
        if (STOCK_IOS.type.equalsIgnoreCase(type)) {
			return STOCK_IOS;
		}
        
        if (STOCK_IOS_PATCH.type.equalsIgnoreCase(type)) {
			return STOCK_IOS_PATCH;
		}

        return null;
    }
}